package com.decent.ejfadmin.collectcard.entity;

import com.decent.ejfadmin.common.bean.SupplyCard;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * describe:手动补结算Bean
 *
 * @author 陈豆豆
 * @date 2019/10/19
 */
@Data
public class ManualClearing {
    /**
     * 主键
     */
    private Long id;
    /**
     * 加款金额（元）
     */
    private BigDecimal addUserPrice;
    /**
     * 申请类型
     */
    private Integer applyType;
    /**
     * 操作人
     */
    private String admin;
    /**
     * 批次号
     */
    private String batchId;
    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime startTime;
    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;
    /**
     * 备注
     */
    private String remark;
    /**
     * 状态
     */
    private Integer status;

    /**
     * 订单号
     */
    private String orderId;
    /**
     * 会员编号
     */
    private Long userId;
    /**
     * 支付宝流水号
     */
    private String zfbOrderId;

    public ManualClearing() {
    }

    public ManualClearing(SupplyCard supplyCard, BigDecimal addUserPrice) {
        this.batchId = supplyCard.getBatchId();
        this.orderId = supplyCard.getOrderId();
        this.userId = supplyCard.getUserId();
        this.addUserPrice = addUserPrice;
    }

    public ManualClearing(SupplyCard supplyCard, String zfbOrderId, BigDecimal addUserPrice, String admin, String remark, Integer status, Integer applyType) {
        this.zfbOrderId = zfbOrderId;
        this.batchId = supplyCard.getBatchId();
        this.orderId = supplyCard.getOrderId();
        this.userId = supplyCard.getUserId();
        this.addUserPrice = addUserPrice;
        this.admin = admin;
        this.remark = remark;
        this.status = status;
        this.applyType = applyType;
    }
}
